import numpy as np
from FbsEnv.utils import FBSUtil

# permutation = np.array(
#                 [
#                     6,
#                     41,
#                     13,
#                     10,
#                     7,
#                     39,
#                     22,
#                     51,
#                     25,
#                     49,
#                     48,
#                     4,
#                     36,
#                     20,
#                     42,
#                     53,
#                     45,
#                     23,
#                     35,
#                     3,
#                     56,
#                     21,
#                     38,
#                     12,
#                     28,
#                     1,
#                     61,
#                     58,
#                     62,
#                     26,
#                     34,
#                     50,
#                     60,
#                     32,
#                     16,
#                     11,
#                     57,
#                     2,
#                     43,
#                     27,
#                     44,
#                     54,
#                     33,
#                     8,
#                     30,
#                     18,
#                     5,
#                     59,
#                     24,
#                     52,
#                     29,
#                     47,
#                     14,
#                     17,
#                     9,
#                     19,
#                     31,
#                     55,
#                     40,
#                     37,
#                     46,
#                     15,
#                 ]
#             )
# bay = np.array(
            #     [
            #         0,
            #         0,
            #         0,
            #         0,
            #         1,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         1,
            #         0,
            #         0,
            #         0,
            #         0,
            #         1,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         1,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         1,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         1,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         0,
            #         1,
            #     ]
            # )


# array = FBSUtil.permutationToArray(permutation, bay)
# new_array = []
# for i in array:
#     new_array.append(i.tolist())
# print(new_array)
array = [
[20,18],
[6,8,7,4,2,1],
[5,19,3],
[12,9,10,14],
[17,13,15],
[16,11]
]
print(FBSUtil.arrayToPermutation(array))